<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<link rel="shortcut icon" href="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/img/logo.png"/>
	<title>账单明细列表</title>
	<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/frame/mui/js/mui.min.js"></script>
	<link href="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/frame/mui/css/mui.min.css" rel="stylesheet" />
	<link href="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/frame/sui/css/SUI.css?b" rel="stylesheet" />
	<link href="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/css/other/all.css" rel="stylesheet" />
	<link href="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/css/other/app.css?a" rel="stylesheet" />
	<link href="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/css/dropload.css" rel="stylesheet" />
</head>
<style type="text/css">
	.mui-content>.mui-table-view:first-child{
		margin-top: 0px;
	}
	.mui-content{padding-bottom: 0}
	.recharge { margin-top: 0; }
	.money_list{overflow: hidden;background: #fff;width: 100%;}
	.money_list>div{width: 100%;overflow: hidden;}
	.money_list div.img{height: 70px;width: 70px;float: left;padding: 10px;}
	.money_list div.img img{width: 100%;border-radius: 5px;}
	.money_list dl:fist-child{border-top: 0}
	.money_list dl{width: calc(100% - 70px);float: left;padding: 10px 10px 10px 0;position: relative;border-top: 1px solid #eaeaea;}
	.money_list dl dt{font-size: 16px;font-weight: 300;line-height: 25px;}
	.money_list dl dd.money{font-size: 20px;font-weight: 600;position: absolute;right: 10px;top: 10px;}
	.money_list dl dd:nth-of-type(2){line-height: 25px;}
	.money_list dl dd:nth-of-type(3){line-height: 25px;color:#aaa;}
	.money_list dl dd ul li {height: 25px;text-align: left;float: left;margin-right: 5px;}
	.money_list dl dd ul li img{width: 25px;height: 25px;float: left;}
	.money_list dl dd ul{width: 100%;overflow: hidden;}
</style>
<body>
	<div class="mui-content">
		<div class="account_balance">
			<p>账户余额(元)</p >
			<div>{{.money}}</div>
		</div>
		<div class="money_list">
			{{range .info}}
			<div>
				<div class="img"><img src="{{.pathname}}"></div>
				<dl>
					<dt>{{if eq .type "0"}}充值余额{{else if eq .type "1"}}余额提现{{else if eq .type "2"}}分销收入{{else if eq .type "3"}}购买商品{{else if eq .type "4"}}推广佣金{{else if eq .type "5"}}店铺收入{{else if eq .type "6"}}退款{{else if eq .type "7"}}店铺退款支出{{else if eq .type "8"}}新人红包{{end}}</dt>
					<dd class="money">{{if eq .type "0" "2" "4" "5" "6" "8"}}＋{{else}}－{{end}}{{.money}}</dd>
					<dd>{{if eq .type "3"}}<ul>{{range .product}}<li><img src="{{.pathname}}">[{{.ordernum}}]</li>{{end}}</ul>{{else}}[{{.name}}]{{end}}</dd>
					<dd>{{.addtime}}</dd>
				</dl>
			</div>
			{{end}}
		</div>
	</div>
</body>
</html>
<script type="text/javascript" src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/frame/sui/js/SUI.js"></script>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/js/zepto.min.js"></script>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/js/dropload.min.js"></script>
{{template "wechat/public/share.html" .}}
<script type="text/javascript">
var page=2
$('.element').dropload({
    scrollArea : window,
    threshold: 2,
    loadDownFn : function(me){
        $.ajax({
            type: 'GET',
            url: window.location.href,
            dataType: 'json',
            data:{page:page},
            success: function(data){
           	  page+=1
           	  var res=data.info
              if(res){
                 for (var i=0;i<res.length;i++){
                    var div = document.createElement('div');
 					var	html=`<div class="img"><img src="`+res[i].pathname+`"></div><dl><dt>`
					switch(res[i].type){
						case "0":
						html+=`充值余额`;break;
						case "1":
						html+=`提现`;break;
						case "2":
						html+=`购买Vip`;break;
						case "3":
						html+=`购买商品`;break;
						case "4":
						html+=`分享收入`;break;
						case "5":
						html+=`店铺收入`;break;
						case "6":
						html+=`退款`;break;
						case "7":
						html+=`店铺退款支出`;break;
						case "8":
						html+=`新人红包`;break;
					}
					html+=`</dt><dd class="money">`
					if(res[i].type==0||res[i].type==2||res[i].type==4||res[i].type==5||res[i].type==6||res[i].type==8){
						html+=`＋`+res[i].money
					}else{
						html+=`－`+res[i].money
					}
					html+=`</dd><dd>`
					if(res[i].type==3){
						html+=`<ul>`
						if(res[i].product){
							for(var j=0;j<res[i].product.length;j++){
								html+=`<li><img src="`+res[i].product[j].pathname+`">[`+res[i].product[j].ordernum+`]</li>`
							}
						}
						html+=`</ul>`
					}else{
						html+=`[`+res[i].name+`]`
					}
					html+=`
					</dd><dd>`+res[i].addtime+`</dd></dl>`
                    div.innerHTML=html
                    document.getElementsByClassName('money_list')[0].appendChild(div)
                }
                me.resetload();
                }else{
                    mui.toast("没有更多了！");
                    $(".dropload-down").remove();
                }
            },
            error: function(xhr, type){
                mui.toast("网络慢，请重新刷新!");
                me.resetload();
            }
        });
    }
});
</script>